package com.lvshi0797.cms.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.lvshi0797.cms.entities.FManager;
@Repository("managerDao")
public class ManagerDao extends BaseDao<FManager> implements IManagerDao {

	@Override
	public boolean checkTelAvailable(String phone) {
		List<FManager> list = this.list("from FManager m where m.phone=?", phone);
		return list.isEmpty();
	}

	@Override
	public boolean checkUsernameAvailable(String username) {
		List<FManager> list = this.list("from FManager m where m.username=?", username);
		return list.isEmpty();
	}

	@Override
	public FManager findByusername(String username) {
		String hql = "from FManager where username=?";
		return (FManager) this.queryObject(hql, username);
	}

	@Override
	public FManager findByphone(String phone) {
		String hql = "from FManager where phone=?";
		return (FManager) this.queryObject(hql, phone);
	}

 

}
